﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LaiHanSLGL.aspx.cs" Theme="Default" Inherits="Web.Pages.YongShui._13.LAIHANGL.LAIHANSLGL" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.ASPxTreeList.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxTreeList" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>来函受理管理</title>
   <script src="../../../JS/jquery.js" type="text/javascript"></script>
    <script src="../../../JS/AddEditCancel.js" type="text/javascript"></script>
    <script type="text/javascript">
        function OpenCuoWuXX(laihanbh, type, ID) {
            if (hdColection.Get("id") == null || hdColection.Get("laihanbh") == null)
            {
                alert("请选择相关来函信息后操作");
                return;
            }
            var parms = "?laihanbh=" + hdColection.Get("laihanbh")  + "&id=" + hdColection.Get("id");
            var url = "";
            var lb = $("#DrpLX_VI").val();
            var width = "900px";
            var height = "620px";
            switch (lb) {
                case "1": url = "/Pages/YongShui/13.LaihanGL/YUEDUTZSL.aspx";
                    break;
                case "2": url = "/Pages/YongShui/13.LaihanGL/NIANDUTZSL.aspx";
                    break;
                case "3": url = "/Pages/YongShui/13.LaihanGL/JiHuaZYSL.aspx";
                    height = "700px";
                    break;

                case "4": url = "/Pages/YongShui/13.LaihanGL/YUEDUTZDJ.aspx";
                    break;
                case "5": url = "/Pages/YongShui/13.LaihanGL/JiJianTZSL.aspx";
                    break;
                case "6": url = "/Pages/YongShui/13.LaihanGL/JiHuaBGSL.aspx";
                    break;
                case "7": url = "/Pages/YongShui/13.LaihanGL/TuiKuanSL.aspx";
                    break;
                case "8": url = "/Pages/YongShui/13.LaihanGL/FenHuSL.aspx";
                    break;
                case "9": url = "/Pages/YongShui/13.LaihanGL/BingHuSL.aspx";
                    break;

                case "10": url = "/Pages/YongShui/13.LaihanGL/GaiHuSL.aspx";
                    height = "700px";
                    break;
                case "11": url = "/Pages/YongShui/13.LaihanGL/XiaoHuSL.aspx";
                    break;
                case "12": url = "/Pages/YongShui/13.LaihanGL/XiaoBiaoSL.aspx";
                    break;
                case "13": url = "/Pages/YongShui/13.LaihanGL/TuiKuanSL.aspx";
                    break;
            }
            if (type == 1) {//修改

                url = url + parms+"&sl=1";
            }
            else {
                url = url;
            }

            openCenter1(url, width, height);
        }

        function openCenter1(openUrl, iWidth, iHeight) {
            var iTop = (window.screen.availHeight - 45 - iHeight) / 2; //获得窗口的垂直位置;
            var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置;
            window.showModalDialog(openUrl,window, "dialogHeight=" + iHeight + ";dialogwidth=" + iWidth + ";dialogLeft=" + iLeft + ";dialogTop=" + iTop + ";scroll=yes;");
        }
   </script>
    <script type="text/javascript">

        document.onkeydown = function () {
            if (event.keyCode == 13) {
                //alert(document.activeElement.id);
                if (document.activeElement.id == "txtYHH_I" || document.activeElement.id == "txtLHBH_I" || document.activeElement.id == "txtXKH_I") {

                    document.getElementById("btnSearch").click();

                }
            }
            else {

            }
        }
        function SetRowValue(values) {
            hdColection.Set("id", values[0]);
            hdColection.Set("laihanbh", values[1]);
        }
    </script>
    <script type="text/javascript">
        function OnInit(s, e) {
            AdjustSize();
        }
        function OnEndCallback(s, e) {
            AdjustSize();
        }

        function AdjustSize() {
            var height = Math.max(0, document.documentElement.clientHeight - document.getElementById("bottom").height - document.getElementById("top").height - 180);
            grid.SetHeight(height);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            来函受理管理
        </div>
        <asp:UpdatePanel runat="server" ID="updatePanel1" style="height:100%">
            <ContentTemplate>
                <dx:ASPxHiddenField ID="hdColection" ClientInstanceName="hdColection" runat="server"></dx:ASPxHiddenField>
                <table style="width: 100%; height: 100%">
                    <tr>
                        <td style="width: 5%; min-width: 100px" valign="top">
                            <div>
                                <dx:ASPxTreeList ID="treeGuanLiK" runat="server" Width="100%" KeyFieldName="S_GUANLIKH" ParentFieldName="S_GUANLIKH"
                                    SettingsPager-AlwaysShowPager="true" AutoGenerateColumns="false" OnFocusedNodeChanged="treeGuanLiK_FocusedNodeChanged"
                                    EnableCallbacks="false">
                                    <Columns>
                                        <dx:TreeListDataColumn FieldName="S_GUANLIKH" Visible="false"></dx:TreeListDataColumn>

                                        <dx:TreeListTextColumn FieldName="S_GUANLIKMC" Caption="名称"></dx:TreeListTextColumn>
                                    </Columns>
                                    <Settings ShowColumnHeaders="false" />
                                    <SettingsBehavior AutoExpandAllNodes="true" AllowFocusedNode="true" ProcessFocusedNodeChangedOnServer="true" ExpandCollapseAction="NodeDblClick" />
                                    <SettingsText LoadingPanelText="正在加载请稍候......" />
                                   
                                    <ClientSideEvents Init="OnInit" EndCallback="OnEndCallback" FocusedNodeChanged="function(s, e) {  
                           
                                                     LoadPanel.Show();  
                                                }" />
                                </dx:ASPxTreeList>
                            </div>
                        </td>
                        <td style="" align="center" valign="top">
                            <table style="width: 100%">
                                <tr id="top">
                                    <td width="80">来函类型：
                                    </td>
                                    <td>

                                        <dx:ASPxComboBox ID="DrpLX" OnSelectedIndexChanged="DrpLX_SelectIndexChange" AutoPostBack="true" runat="server" ValueType="System.String">

                                            <ClientSideEvents SelectedIndexChanged="function(s, e) {  
                           
                                                     LoadPanel.Show();  
                                                }" />
                                        </dx:ASPxComboBox>

                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <br />
                                        <fieldset style="border: 1px solid  cornflowerblue;">
                                            <legend><b>查询结果</b></legend>

                                            <dx:ASPxGridView ID="gvWenJianGZ" ClientInstanceName="grid"  FocusedRowChanged="gvWenJianGZ_FocusedRowChanged" runat="server" AutoGenerateColumns="False" KeyFieldName="ID" Width="100%" Theme="Aqua1">

                                                <Columns>
                                                    <dx:GridViewDataTextColumn FieldName="S_LAIHANBH" Caption="来函编号" Width="100px" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="S_BEIYONG1" Caption="许可受理号" Width="110px" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="S_TONGYIBM" Caption="统一编码" Width="110px" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="S_LAIHANLXMC" Caption="函件类型" Width="80px" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>


                                                    <dx:GridViewDataTextColumn FieldName="S_YONGHUBH" Caption="用户号" Width="80px" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="S_YONGHUM" Caption="用户名" Width="300px" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>

                                                    <dx:GridViewDataTextColumn FieldName="YM" Caption="水量年月" Width="60px" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="YWY" Caption="业务员" Width="60px" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>

                                                    <dx:GridViewDataTextColumn FieldName="D_LAIHANRQ" PropertiesTextEdit-DisplayFormatString="{0:yyyy-MM-dd}" Width="80px" Caption="来函日期" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="D_SHURURQ" PropertiesTextEdit-DisplayFormatString="{0:yyyy-MM-dd}" Width="80px" Caption="登记日期" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>

                                                    <dx:GridViewDataTextColumn FieldName="D_SHENPIRQ" Caption="审批日期" PropertiesTextEdit-DisplayFormatString="{0:yyyy-MM-dd}" Width="80px" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="SPJG" Caption="审批结果" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="S_LIUCHENGZT" Caption="流程状态" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                                                </Columns>
                                                <SettingsBehavior AllowSort="false" />
                                                <Settings VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" />
                                                <ClientSideEvents Init="OnInit" EndCallback="OnEndCallback"  FocusedRowChanged="function(s, e) {   
                                                    s.GetRowValues(grid.GetFocusedRowIndex(), 'ID;S_LAIHANBH', SetRowValue);}"/>
                                            </dx:ASPxGridView>
                                            <br />

                                        </fieldset>

                                    </td>
                                </tr>
                                <tr id="bottom">
                                    <td colspan="2">
                                        <table style="width: 100%">
                                            <tr>
                                                <td>来函编号
                                                </td>
                                                <td>
                                                    <dx:ASPxTextBox ID="txtLHBH" runat="server" Width="100px"></dx:ASPxTextBox>

                                                </td>
                                                <td>用户号

                                                </td>
                                                <td>

                                                    <dx:ASPxTextBox ID="txtYHH" runat="server" Width="100px"></dx:ASPxTextBox>
                                                </td>
                                                <td>许可受理号
                                                </td>
                                                <td>
                                                    <dx:ASPxTextBox ID="txtXKH" runat="server" Width="100px"></dx:ASPxTextBox>

                                                </td>
                                                <td>

                                                    <dx:ASPxLoadingPanel ID="LoadPanel" Theme="Metropolis" ClientInstanceName="LoadPanel" runat="server" Modal="True" Text="正在查询..."></dx:ASPxLoadingPanel>
                                                </td>
                                                <td align="right">

                                                    <dx:ASPxButton ID="BtnEdit" runat="server" Text="预受理" AutoPostBack="false" UseSubmitBehavior="false" >
                                                       <ClientSideEvents Click="function(s,e){OpenCuoWuXX('',1,1);}" />
                                                    </dx:ASPxButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>

                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <div style="display: none;">
                    <asp:Button ID="btnSearch" runat="server" Text="Button" OnClick="BtnSearch_Click" />
                    <asp:HiddenField ID="confirmValue" runat="server" />
                    <asp:HiddenField ID="lanhanbh" runat="server" />
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
